package com.java.yz.day15.factorydemo1;


//动物工厂
public class AnimalFactory1 {
    private AnimalFactory1(){}

    public static Animal getAnimal(String name){
        if (name.equals("dog")){
            return new Dog();
        }else {
            System.out.println("目前工厂还没有该动物");
            return null;
        }
    }
}
